WEBVTT
Kind: captions
Language: en

00:00:05.074 --> 00:00:06.040
[ambient noise]

00:00:06.040 --> 00:00:08.818
My car knows when it’s wet.

00:00:08.818 --> 00:00:11.508
That’s right,&nbsp;it’s got automatic windshield wipers.

00:00:11.508 --> 00:00:15.002
When they’re set to automatic, and the car&nbsp;gets wet, they wipe.

00:00:15.002 --> 00:00:16.668
How it know that?

00:00:16.668 --> 00:00:18.397
It’s actually really simple.

00:00:18.397 --> 00:00:19.704
If you look&nbsp;at the windshield,

00:00:19.704 --> 00:00:22.915
you’ll notice an area near the top center which is black.

00:00:22.915 --> 00:00:28.332
And if you&nbsp;look closelier you’ll see the component
the car uses to determine windshield wetness.

00:00:28.761 --> 00:00:30.126
Oh, the&nbsp;camera?

00:00:30.126 --> 00:00:33.027
No, it's not the camera - that’d be silly!

00:00:33.080 --> 00:00:39.295
Then you’d have to devote some precious clock&nbsp;cycles
away from the already wildly complicated&nbsp;computer vision tasks

00:00:39.295 --> 00:00:42.220
which help keep the car&nbsp;centered in its lane.

00:00:42.220 --> 00:00:43.459
That seems like a weird decision

00:00:43.459 --> 00:00:47.739
and I don’t even know how well that&nbsp;could possibly work
no matter how many software updates you throw at it.

00:00:48.614 --> 00:00:51.596
No, I’m not alluding to anything&nbsp;specific,
why on Earth would you think that?

00:00:51.596 --> 00:00:59.767
Right above that camera which looks forward at the&nbsp;road
you’ll see a little circular spot with some spots within the spot and that, viewers,

00:00:59.767 --> 00:01:01.712
is the&nbsp;rain sensor.

00:01:01.712 --> 00:01:04.841
Look, I get it wet - and the car wipes!

00:01:04.841 --> 00:01:06.469
But two can play at that game.

00:01:07.721 --> 00:01:11.882
You may&nbsp;think this is wildly complicated and expensive technology

00:01:11.882 --> 00:01:18.912
but actually it’s just two of the&nbsp;simplest electronic components you can imagine working together in a very clever way.

00:01:18.912 --> 00:01:25.207
Below the&nbsp;dark portions of the rain sensor are
infrared LEDs shining light up into the glass,

00:01:25.207 --> 00:01:29.190
and adjacent&nbsp;to them are photodiodes which detect that light.

00:01:29.190 --> 00:01:31.731
Now, that bright spot at the bottom?

00:01:31.731 --> 00:01:33.842
That’s&nbsp;not actually part of the rain sensor.

00:01:33.920 --> 00:01:38.576
It’s an ambient light sensor used to control the&nbsp;car’s headlights automatically.

00:01:38.576 --> 00:01:41.515
The two components just live in the same assembly.

00:01:41.515 --> 00:01:44.734
The parts that&nbsp;make up the rain sensor aren’t really visible

00:01:44.734 --> 00:01:50.433
because they’re below a filter which blocks&nbsp;visible light
and thus it appears black to our eyes.

00:01:51.771 --> 00:01:55.143
That’s strange, didn’t we just encounter that with&nbsp;stovetops?

00:01:55.143 --> 00:01:57.527
Weird connections happening lately.

00:01:57.527 --> 00:02:02.772
To demonstrate how that detects rain,
I’ll&nbsp;use a piece of glass and a laser pointer.

00:02:02.772 --> 00:02:06.614
If I shine the laser up at the glass at about a&nbsp;45 degree angle,

00:02:06.614 --> 00:02:11.420
you’ll notice that a spot of laser light is reflected back down towards the table.

00:02:11.420 --> 00:02:14.515
I’ll put a piece of paper there to make it more visible.

00:02:14.515 --> 00:02:17.408
Now watch what happens when I get the&nbsp;glass wet.

00:02:18.334 --> 00:02:19.786
Not a whole lot.

00:02:20.386 --> 00:02:21.648
That’s a bummer.

00:02:21.648 --> 00:02:27.507
Ah, but this isn’t actually an accurate&nbsp;demonstration
of the principles involved in the rain sensor.

00:02:27.507 --> 00:02:31.393
Rather than look at the&nbsp;light reflected back downward by the glass,

00:02:31.393 --> 00:02:36.554
let’s look at the spot produced above the glass by&nbsp;
the laser light which makes it through.

00:02:36.554 --> 00:02:38.014
Now watch closely.

00:02:38.460 --> 00:02:41.036
Did you see that? It moved.

00:02:41.036 --> 00:02:48.991
That happened&nbsp;because the water on top of the glass
changed the angle of refraction as light left the glass.

00:02:48.991 --> 00:02:53.397
Now,&nbsp;like some politicians, I’m really not really good at the whole optics thing

00:02:53.397 --> 00:02:55.858
so I’m not getting too deep&nbsp;into the weeds here.

00:02:55.858 --> 00:03:01.042
But as light passes from one medium to another,
its speed actually changes

00:03:01.042 --> 00:03:05.768
and because of… reasons that means it appears to change direction.

00:03:05.768 --> 00:03:07.967
That concept is known as&nbsp;refraction.

00:03:07.967 --> 00:03:12.485
And the refraction index of water is different from that of air.

00:03:12.485 --> 00:03:22.502
That means the change&nbsp;in speed and thus change in refraction angle is different between light passing from glass into&nbsp;air and light passing from glass into water.

00:03:22.880 --> 00:03:25.946
The rain sensor, though, is entirely under the&nbsp;glass

00:03:25.946 --> 00:03:29.779
so it’s not as if it can directly detect that change.

00:03:29.779 --> 00:03:34.080
Instead, it leverages the effect of&nbsp;total internal reflection.

00:03:34.080 --> 00:03:40.090
If you’ve ever gone swimming in a pool with goggles on and looked&nbsp;up at the surface of the water while submerged,

00:03:40.090 --> 00:03:44.061
you may have noticed that it looks like&nbsp;a mirror from shallow angles.

00:03:44.061 --> 00:03:46.487
Here’s some stock footage to illustrate.

00:03:46.487 --> 00:03:54.067
That’s&nbsp;total internal reflection at work - the water directly above you
transmits light&nbsp;just fine and you can see through it,

00:03:54.067 --> 00:04:00.377
but there’s a critical angle at which the
air-water interface will reflect all light back down

00:04:00.377 --> 00:04:04.481
and since it’s smooth like&nbsp;glass, it looks like a mirror.

00:04:04.481 --> 00:04:07.975
So now - how can the rain sensor take advantage&nbsp;of that?

00:04:07.975 --> 00:04:11.374
Well, first, since the module isn’t part of the glass,

00:04:11.374 --> 00:04:20.067
we need an optical interface&nbsp;material to couple the sensor to the glass
and remove the air-to-glass optical interface on the bottom.

00:04:20.067 --> 00:04:26.184
That takes the form of a sticky gel which, now that it’s in-place, you can’t see.

00:04:26.184 --> 00:04:29.082
Which, really, is the point - when it’s doing its job,

00:04:29.082 --> 00:04:31.842
the sensor and the glass become&nbsp;one

00:04:31.842 --> 00:04:33.854
(from an optical perspective).

00:04:33.854 --> 00:04:37.788
Now the key is that the infrared LEDs that&nbsp;we talked about earlier

00:04:37.788 --> 00:04:44.476
are shining up at the glass just shallow
of the critical angle of&nbsp;total internal reflection.

00:04:44.476 --> 00:04:51.893
So, all the light they produce will simply bounce off
the top surface of the the glass and&nbsp;head back downward.

00:04:51.893 --> 00:04:55.884
And, at the other end of that beam of light, is a photodiode.

00:04:55.884 --> 00:04:59.982
That will then&nbsp;detect the light being generated by the LED.

00:04:59.982 --> 00:05:03.291
And to make sure it’s detecting that light and&nbsp;not something else,

00:05:03.291 --> 00:05:09.157
the LEDs are actually rapidly blinking
and the photodiode is looking for that&nbsp;pattern of blinks.

00:05:09.157 --> 00:05:16.948
That’s a simpler way of saying the LEDs are producing
a specific modulated&nbsp;signal that the photodiode is tuned to detect.

00:05:16.948 --> 00:05:24.925
But because the angle between the photodiode and&nbsp;
the LED is so close to the critical angle of total internal reflection,

00:05:24.925 --> 00:05:33.133
if conditions should change&nbsp;the intensity of that signal
being received by the photodiode will also change.

00:05:33.133 --> 00:05:34.472
What condition?

00:05:34.472 --> 00:05:36.184
Condition wet.

00:05:36.184 --> 00:05:44.455
Water on the glass, as we saw in the earlier demo,
changes the refraction angle&nbsp;because its refractive index is different from air.

00:05:44.455 --> 00:05:50.056
And it will change it just enough to break&nbsp;the effect of total internal reflection.

00:05:50.056 --> 00:05:58.015
Wet glass will allow some of the light produced by the LEDs&nbsp;
to actually escape and be transmitted through to the outside surface.

00:05:58.015 --> 00:06:03.132
Which in turn means there’s&nbsp;less light bouncing down
to the photodiode to be detected,

00:06:03.132 --> 00:06:06.582
so the signal it was receiving&nbsp;begins to diminish.

00:06:06.582 --> 00:06:14.330
And, with a little logic circuitry and programming, you can use that loss&nbsp;of signal as a measurement of windshield wetness.

00:06:14.330 --> 00:06:17.058
And honestly… that’s it!

00:06:17.058 --> 00:06:18.491
It’s that simple.

00:06:18.491 --> 00:06:24.111
The sensor starts to see the signal from the LED drop out
so it says to the windshield&nbsp;wiper motor -

00:06:24.111 --> 00:06:25.321
wipe.

00:06:25.321 --> 00:06:29.738
And the wetter the glass,
the more the signal drops, so the more&nbsp;it wipes.

00:06:29.738 --> 00:06:37.064
And you’ll notice the sensor is deliberately placed in the path of&nbsp;the windshield wipers so they clear the glass with every wipe.

00:06:37.064 --> 00:06:45.155
That allows the&nbsp;logic to get some sense of how hard it might be raining
based on how quickly the&nbsp;signal drops out after every wiping event.

00:06:45.240 --> 00:06:48.594
The only other complexity here is&nbsp;calibration.

00:06:48.594 --> 00:06:55.251
Every time the sensor powers up, it’s got to pick a baseline&nbsp;
signal level which it deems “dry.”

00:06:55.251 --> 00:07:00.880
Yet, if you are out and about in the rain
and you&nbsp;turn your car on with the windshield already wet,

00:07:00.880 --> 00:07:05.095
it’s going to start out with some lower signal&nbsp;level than typical.

00:07:05.095 --> 00:07:12.080
So, somebody smarter than me probably established
a minimum signal&nbsp;dropout level which always causes a wipe,&nbsp;&nbsp;

00:07:12.080 --> 00:07:17.121
and in fact I’m certain I’ve encountered the&nbsp;
car do a single wipe after turning it on

00:07:17.121 --> 00:07:19.889
when it didn’t really need to.

00:07:19.889 --> 00:07:23.680
But then it can reset&nbsp;its calibration after that wiping event.

00:07:23.680 --> 00:07:28.117
And, there’s another trick up its sleeve,
and it's&nbsp;my very favorite one:

00:07:28.117 --> 00:07:29.520
having two of them.

00:07:30.160 --> 00:07:33.109
There are actually two sensor assemblies under here.

00:07:33.109 --> 00:07:37.654
You can barely make out the infrared light in this smartphone camera footage.

00:07:37.654 --> 00:07:39.751
You'll see there's two spots.

00:07:39.751 --> 00:07:44.223
If the windshield&nbsp;is dry, the two sensors should see very similar signals

00:07:44.223 --> 00:07:50.352
but if there’s even just a tiny bit of&nbsp;water on top of one of them,
 or differing amounts between the two,

00:07:50.352 --> 00:07:56.250
then the two signals will be&nbsp;very different
and it will know immediately that the windshield is wet.

00:07:56.250 --> 00:07:58.988
Which calibration&nbsp;method is it actually using?

00:07:58.988 --> 00:08:00.438
I do not know.

00:08:00.438 --> 00:08:09.360
And if you’ve never lived with a car with&nbsp;automatic wipers,
you may wish to know they are great but not exactly perfect.

00:08:09.360 --> 00:08:15.646
You are afforded&nbsp;a sensitivity adjustment on the wiper stalk,
so you can fine-tune its behavior to your&nbsp;liking.

00:08:15.646 --> 00:08:19.883
But while the wipers pretty much always come on when they need to,

00:08:19.883 --> 00:08:27.665
sometimes they&nbsp;go absolutely nuts when it’s barely raining
or they get a little lazy in a sudden downpour.

00:08:27.665 --> 00:08:34.252
Lucky&nbsp;for me, if that happens all I have to do
is just slap this stalk which is right next to&nbsp;my hand on the steering wheel

00:08:34.252 --> 00:08:37.167
and the wipers will come on full-steam!

00:08:37.167 --> 00:08:39.287
Handy user interface,&nbsp;those stalks.

00:08:39.287 --> 00:08:42.173
They’re always there and muscle memory takes over!

00:08:42.173 --> 00:08:45.788
I’m pro-stalks,&nbsp;is what I’m saying. It’s a good idea.

00:08:45.788 --> 00:08:53.623
What’s less of a good idea, though, is the&nbsp;Konami-code like trick
I had to look up just to change my car’s wiper blades.

00:08:53.623 --> 00:09:00.993
The hood&nbsp;blocks you from lifting the wiper arms
so you need them to stop in the up position in order to&nbsp;change them.

00:09:00.993 --> 00:09:06.199
and despite digging through all the settings menus
I couldn’t find a “change wipers”&nbsp;option.

00:09:06.199 --> 00:09:12.399
So I tried just switching the car off with the wipers in the up position,
y'know just time it right, using the power&nbsp;button,

00:09:12.399 --> 00:09:15.527
but it outsmarted me and parked them anyway.

00:09:15.527 --> 00:09:23.154
It turns out what you have to do is turn&nbsp;the car off and then hold the wiper stalk up in the mist position for a few moments

00:09:23.154 --> 00:09:26.102
and then the&nbsp;car will do this.

00:09:26.102 --> 00:09:28.640
Is this procedure in the owner’s manual?

00:09:30.240 --> 00:09:33.640
Yes, but who looks there for information?

00:09:33.640 --> 00:09:37.824
I usually like to end my videos with&nbsp;something akin to a moral.

00:09:37.824 --> 00:09:41.015
In that vein, the first lesson today is for me

00:09:41.015 --> 00:09:43.778
and that&nbsp;is to read the freaking manual!

00:09:43.778 --> 00:09:49.557
There’s even an index in here and finding the appropriate&nbsp;
information would have taken me mere moments.

00:09:49.557 --> 00:09:53.471
People worked hard on this thing&nbsp;and I just… completely ignored it!

00:09:53.471 --> 00:09:56.848
So don’t ignore the manuals in your life.

00:09:56.848 --> 00:09:58.556
And the second moral is…

00:09:58.556 --> 00:10:01.519
don’t ignore what you can do with a few simple components.

00:10:01.519 --> 00:10:03.514
Software isn’t everything.

00:10:04.286 --> 00:10:07.310
That’s&nbsp;not directed at any organization in particular, mind you.

00:10:07.310 --> 00:10:08.992
Just something to keep in&nbsp;mind.

00:10:09.609 --> 00:10:11.118
Did I get to 10 minutes yet?

00:10:11.958 --> 00:10:14.503
♫ internally smooth jazz ♫

00:10:15.326 --> 00:10:20.857
Thanks, by the way, to Jason, a supporter&nbsp;on Patreon,
for recommending this video topic.

00:10:20.857 --> 00:10:27.793
That happened a long time ago&nbsp;and I’m pretty certain at least one other person has suggested this in the&nbsp;meantime

00:10:27.793 --> 00:10:30.549
so if I forgot who you were, I’m sorry.

00:10:30.549 --> 00:10:33.046
There’s just too many&nbsp;bimetallic strips getting in the way.

00:10:34.675 --> 00:10:37.528
That’s right, it’s got automatic…&nbsp;the thing didn’t start.

00:10:37.528 --> 00:10:40.997
You’ll notice that the spot&nbsp;of laser light is re… oh.

00:10:40.997 --> 00:10:44.038
…conditions should change, the intensity&nbsp;of a-

00:10:45.530 --> 00:10:48.841
Ooh, I needed a comma for my sake

00:10:48.841 --> 00:10:51.883
...critical angle of total internal reflection

00:10:51.883 --> 00:10:52.948
[annoyance at outside noise]

00:10:52.948 --> 00:10:55.956
...it’s got to pick a baseline&nbsp;signal lever.

00:10:55.956 --> 00:10:56.806
Signal.

00:10:56.806 --> 00:10:57.619
Level.

00:10:57.619 --> 00:11:00.113
...had to look, oh yeah I forgo&nbsp;ohyeahIgottagetthething!

00:11:01.176 --> 00:11:05.751
You mean to say all you need is an LED, a photodiode, and a bit of adhesive to take the task of detecting rain away from a sophisticated computer vision system?

00:11:05.751 --> 00:11:08.288
And that this was a technology available back in the nineties?

00:11:08.288 --> 00:11:12.797
That sounds unpossible, I mean if there were a better way to do things, surely it would only come from the halls of one particular company and not anyone else.

00:11:13.003 --> 00:11:15.188
This section is usually for puns but today I chose vicious sarcasm.

00:11:15.188 --> 00:11:17.076
Not directed at any particular organization, of course :)

